package com.ys.service.Impl;

import com.ys.mapper.AdministratorsMapper;
import com.ys.pojo.Administrators;
import com.ys.pojo.Menu;
import com.ys.service.AdministratorsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("administratorsService")
public class AdministratorsServiceImpl implements AdministratorsService {
    @Resource
    private AdministratorsMapper administratorsMapper;
    @Override
    public Administrators login(String name) {
        return administratorsMapper.findByAccountAndpassword(name);
    }

    @Override
    public int updateUplaod(String names,int id) {
        return administratorsMapper.updateUplaod(names,id);
    }

    @Override
    public List<Administrators> finalByAll(Administrators ad) {
        return administratorsMapper.finalByAll(ad.getAnames(),ad.getPhone(),ad.getPosi(),ad.getState());
    }

    @Override
    public Administrators finalByAllobj(String id) {
        return administratorsMapper.finalByAllobj(id);
    }

    @Override
    public boolean addsInsert(Administrators ad) {
        return administratorsMapper.insert(ad);
    }

    @Override
    public boolean updateGangwei(int id, int ids) {
        return administratorsMapper.updateGangwei(id,ids);
    }

    @Override
    public int updsupdataUser(Administrators ad) {
        return administratorsMapper.updsupdataUser(ad);
    }

    @Override
    public boolean updatePwd(String pwd, String shiro, Integer id) {
        return administratorsMapper.updatePwd(pwd,shiro,id);
    }

    @Override
    public List<Administrators> findAdministratorsId() {
        return administratorsMapper.findAdministratorsId();
    }


}
